The present disclosure relates to an image processing device, a method of controlling the image processing device, and a program for enabling a computer to execute the method. More particularly, the present disclosure relates to an image processing device capable of performing a blur process, a method of controlling the image processing device, and a program for enabling a computer to execute the method.
In recent years, an image capturing apparatus which can measure a depth of a target to be captured has been commonly used. An example of a method for measuring the depth includes a depth from defocus (DFD) method, a stereo matching method, and so on. In the DFD method, the degree of blur for a subject in an image is analyzed, and the depth from image capturing apparatus to the subject is measured based on a relationship between the degree of blur and the depth. In the stereo matching method, a parallax is detected from a criterion image and a reference image, and the depth from the image capturing apparatus to the subject is measured based on a relationship between the parallax and the depth.
There has been proposed an image capturing apparatus which measures the depth from the image capturing apparatus to a subject using the above-mentioned methods and performs a blur process on a background of a main subject in accordance with the depth in a state that the main subject is kept in focus (see, for example, Japanese Patent Application Laid-open Publication No. 2003-37767). An image with enhanced perspective is generated by performing the blur process in accordance with the depth. This blur process is often used for clearly showing a person against a background in portrait photographs. In the image capturing apparatus equipped with image capturing elements having small light-receiving area, an image with a relatively less blurring is captured because of the characteristics of the image capturing elements, thus this blur process is commonly used to enhance the perspective of an image.